import { ref } from 'vue'

export const usePageControl = () => {
  const visible = ref(false)

  const showPage = () => {
    visible.value = true
  }

  const hidePage = () => {
    visible.value = false
  }

  const active = (callback) => {
    if (typeof callback !== 'function') return
    callback()
  }

  return {
    visible,
    showPage,
    hidePage,
    active,
  }
}
